{include file="header.tpl.html"}

<div id="divContent" class="widthContent radiusDiv shadowDiv backWhite textAlignLeft tableDiv" style="height:auto;">
	<div class="tableDiv" >
		<div class="rowTableDiv" > 
			<div class="cellTableDiv widthContent divFloat darkBlueEffect leftTopRadiusDiv rightTopRadiusDiv"  style="height: 25px;"> 
				&nbsp;
			</div>
		</div>			
	</div>	
	<div class="tableDiv mediumGreyDiv2" style="padding-top:0px;padding-bottom:0px;">
		
		<div class="rowTableDiv" > 
			<div class="cellTableDiv2 widthContent1 divFloat lightGreyDiv" > 
				<p class="pCellDiv ">Seleziona la campagna lavorata</p>
			</div>
			<div class="cellTableDiv2 widthContent2 divFloat " > 
				<p class="pCellDiv2">
					<select name="idCampagna" id="idCampagna" class="selectGeneric2 radiusInput widthCosto" onChange="">
						<option value="">...</option>
						{section name=idx loop=$idCampagnaLS}
							<option value="{$idCampagnaLS[idx]}">{$clienteLS[idx]} {$campagnaLS[idx]}</option>
						{/section}
					</select>
				</p>
			</div>
		</div>
		
		<div class="rowTableDiv" > 
			<div class="cellTableDiv2 divFloat lightGreyDiv" > 
				<p class="pCellDiv ">Inserisci il numero di ore lavorate</p>
			</div>
			<div class="cellTableDiv2 divFloat" > 
				<p class="pCellDiv2">
					<select name="oreLavorate" id="oreLavorate" class="selectGeneric2 radiusInput widthCosto" onChange="">
						<option value="" selected>...</option>
						<option value="0">0</option>
						<option value="1">1</option>
						<option value="2">2</option>
						<option value="3">3</option>
						<option value="4">4</option>
						<option value="5">5</option>
						<option value="6">6</option>
						<option value="7">7</option>
						<option value="8">8</option>
						<option value="9">9</option>
						<option value="10">10</option>
						<option value="12">12</option>
					</select>
					&nbsp; ore &nbsp;&nbsp;&nbsp;
					<select name="minutiLavorati" id="minutiLavorati" class="selectGeneric2 radiusInput widthCosto" onChange="">
						<option value="" selected>...</option>
						<option value="0">0</option>
						<option value="25">15</option>
						<option value="50">30</option>
						<option value="75">45</option>
					</select>
					&nbsp; minuti &nbsp;&nbsp;&nbsp;
				</p>
			</div>
		</div>
		<div class="rowTableDiv" >
			<div class="cellTableDiv divFloat lightGreyDiv" > 
				<p class="pCellDiv ">Note</p>
			</div>
			<div class="cellTableDiv divFloat" > 
				<p class="pCellDiv2">
					<textarea name="note" rows="7" class="inputHidden1 widthMax100" >{$note}</textarea>
				</p>
			</div>
		</div>
	</div>
	
	
 
	
	<div class="tableDiv" >
		<div class="rowTableDiv" >                        
			<div class="cellTableDiv widthContent divFloat darkBlueEffect leftBottomRadiusDiv rightBottomRadiusDiv"  style="height: 0px;"> 
				&nbsp;
			</div>
		</div>			
	</div>	
</div>

<div class="widthContent textAlignRight tableDiv" style="margin-top:20px;" >
	<input type="button" value="Salva" class="buttonNew3 effectImage radiusButton shadowButton"  onclick="_submitSave()"/>
</div>	



</br>


{include file="funcMisc.js"}
{include file="funcSelect.js"}
{include file="funcPopup.js"}


<input type="hidden" name="save" id="save" value="" />

<script type="text/javascript">
selectOption("idCampagna","{$idCampagna}");
selectOption("oreLavorate","{$oreLavorate}");
selectOption("minutiLavorati","{$minutiLavorati}");

{literal}

function _submitSave()
{
	popMsg.resetValueObjMsg();
	
	if (document.main.idCampagna.value == '')
	{
		usrMessageDsc = "Selezionare la campagna lavorata";
		popMsg.warning();	
		return;
	}
	if (document.main.oreLavorate.value == '')
	{
		usrMessageDsc = "Selezionare le ore lavorate";
		popMsg.warning();	
		return;
	}
	if (document.main.minutiLavorati.value == '')
	{
		usrMessageDsc = "Selezionare i minuti lavorati";
		popMsg.warning();	
		return;
	}
	
	if (document.main.minutiLavorati.value == 0 && document.main.oreLavorate.value == 0)
	{
		usrMessageDsc = "Non puoi inserire un'orario di lavoro di 0 ore e 0 minuti";
		popMsg.error();	
		return;
	}
	
	document.main.save.value = 'S';
	document.main.submit();
	
	//usrMessageDsc = "Operazione Eseguita!";
	//popMsg.info();
}
	
	
{/literal}


</script>
 
{include file="usrObjPopupMsg.tpl.html"}
{include file="footer.tpl.html"} 
 

